package com.frame.demo.injector.moudle;

import android.content.Context;

import com.frame.demo.app.MyApplication;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * 提供全局注入对象
 * @author liuxia
 * @version 1.0
 * @date 2015/12/22
 */
@Module
public class ApplicationModule {

    protected final MyApplication mApplication;

    public ApplicationModule(MyApplication application) {
        mApplication = application;
    }

    @Provides
    @Singleton
    MyApplication provideApplication() {
        return mApplication;
    }

    @Provides
    @Singleton
    Context provideApplicationContext() {
        return mApplication.getApplicationContext();
    }

}
